﻿Public Class modify_password

    Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        rs = New ADODB.Recordset
        rs.Open("SELECT * from account", cn, 3, 2)
        If Not rs.EOF Then
            TextBox4.Text = rs.Fields("username").Value
        End If
        rs.Close()
        rs = Nothing

        If TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox1.Text = "" Then
            MsgBox("Supply all Fields")
        Else
            If TextBox2.Text.Equals(TextBox3.Text) Then
                rs = New ADODB.Recordset
                rs.Open("SELECT * from Account where username = '" & TextBox4.Text & "'", cn, 3, 2)
                rs.Fields("password").Value = TextBox2.Text
                rs.Update()
                rs.Close()
                rs = Nothing
                MsgBox("Successfully Updated")
                MainScreen.Show()
                Me.Hide()
            Else
                MsgBox("2 Password Input are not Equal")
            End If


        End If






    End Sub

    Private Sub modify_password_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Module1.connect()


    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        accountmgnt.Show()
        Me.Hide()

    End Sub
End Class